//
//  RefreshView.h
//  XinDong
//
//  Created by tt on 12-11-8.
//  Copyright (c) 2012年 HengYongKeJi. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol RefreshDelegate;

@interface RefreshView : UIView
{
    id __unsafe_unretained _delegate;
	RefreshState _state;
	RefreshViewPosition _position;
	CALayer *_arrowImage;
	UIActivityIndicatorView *_activityView;
	UILabel *_lastUpdatedLabel;
	UILabel *_statusLabel;
    BOOL _autoPulling;
}
@property(nonatomic,unsafe_unretained) id <RefreshDelegate> delegate;

- (id)initWithFrame:(CGRect)frame position:(RefreshViewPosition)position;
- (void)refreshLastUpdatedDate;
- (void)refreshScrollViewDidScroll:(UIScrollView *)scrollView;
- (void)refreshScrollViewDidEndDragging:(UIScrollView *)scrollView;
- (void)refreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView;
- (void)setState:(RefreshState)aState;
- (void)setAutoPulling:(BOOL)autoPulling;
@end

@protocol RefreshDelegate
- (void)refreshDidTriggerRefresh:(RefreshView*)view;
- (BOOL)refreshDataSourceIsLoading:(RefreshView*)view;

@optional
- (NSDate*)refreshTableHeaderDataSourceLastUpdated:(RefreshView*)view;

